﻿using System;

namespace DotNetRepository.UnitTests
{
    public class Order : IEntity
    {
        public Guid ID { get; set; }

        public long Version { get; set; }

        public void IncrementVersion()
        {
            Version++;
        }

        [CorrespondingEnumeration(Name="_orders")]
        private readonly IEntityRef<Customer> _customer = new EntityRef<Customer>(false,false);
        
        public Guid CustomerID
        {
            get { return _customer.ID; }
            set { _customer.ID = value; }
        }
    
        public Customer Customer
        {
            get { return _customer.Value; }
            set { _customer.ID = value == null ? Guid.Empty : value.ID; }
        }

        public string Description{ get; set;}
    }
}
